@alwith/module-chat 0.6.25 → 0.6.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/README.md +26 -34
  2. package/dist/agent/client.js +1 -1
  3. package/dist/agent/custom-model-effort.js +1 -1
  4. package/dist/agent/image-request.js +1 -1
  5. package/dist/agent/image-tools.js +1 -1
  6. package/dist/agent/input-config.js +1 -1
  7. package/dist/agent/input-modes/execution-meta.js +1 -1
  8. package/dist/agent/input-modes/image.js +1 -1
  9. package/dist/agent/input-modes/index.js +1 -1
  10. package/dist/app-reference.js +1 -1
  11. package/dist/application-tools.d.ts +23 -12
  12. package/dist/application-tools.js +1 -1
  13. package/dist/approval/choice-elicitation-form.js +1 -1
  14. package/dist/approval/choice-schema.js +1 -1
  15. package/dist/approval/permission-options.js +1 -1
  16. package/dist/approval/permission-view.js +1 -1
  17. package/dist/approval/schema-elicitation-form.js +1 -1
  18. package/dist/approval/url-elicitation-card.js +1 -1
  19. package/dist/{chunk-mc21sg7m.js → chunk-0e5dx357.js} +1 -1
  20. package/dist/{chunk-arm9x6kc.js → chunk-0enb3f4n.js} +2 -2
  21. package/dist/{chunk-knxes674.js → chunk-0jg7hgp5.js} +2 -2
  22. package/dist/{chunk-27gr882d.js → chunk-0m4s668v.js} +2 -2
  23. package/dist/{chunk-cf85zhvf.js → chunk-16dyzkha.js} +1 -1
  24. package/dist/{chunk-dr5swvaa.js → chunk-18kdsdmy.js} +2 -2
  25. package/dist/{chunk-x2wcwpw3.js → chunk-1wr1ef9x.js} +2 -2
  26. package/dist/{chunk-zq26pxze.js → chunk-24y0mvqf.js} +2 -2
  27. package/dist/{chunk-q9b2wsdg.js → chunk-2bbdgf43.js} +2 -2
  28. package/dist/chunk-2f8s5gtn.js +2 -0
  29. package/dist/{chunk-tcg99k9e.js → chunk-2yvj9k42.js} +1 -1
  30. package/dist/{chunk-g4qwh2sx.js → chunk-30nre2gw.js} +1 -1
  31. package/dist/{chunk-sjb5stzq.js → chunk-317w17va.js} +2 -2
  32. package/dist/{chunk-2x5m7g33.js → chunk-3hsft68c.js} +1 -1
  33. package/dist/{chunk-vfszr27e.js → chunk-3nawfa7b.js} +2 -2
  34. package/dist/{chunk-d06382wz.js → chunk-3qedn07q.js} +2 -2
  35. package/dist/{chunk-c2r7xpjf.js → chunk-3z86hy2s.js} +2 -2
  36. package/dist/{chunk-5m2ydb9j.js → chunk-4a4awnss.js} +2 -2
  37. package/dist/{chunk-npkk2gzs.js → chunk-4d9sajzj.js} +2 -2
  38. package/dist/{chunk-1d29gnb2.js → chunk-4g1s7gdh.js} +2 -2
  39. package/dist/{chunk-x8rfc6wc.js → chunk-4sfxcw58.js} +3 -3
  40. package/dist/chunk-51xk5tw2.js +2 -0
  41. package/dist/chunk-53r6pr16.js +2 -0
  42. package/dist/{chunk-k7z0pgrt.js → chunk-55m88zbv.js} +2 -2
  43. package/dist/{chunk-kvc3ghat.js → chunk-5bhp61sd.js} +1 -1
  44. package/dist/chunk-5mjs63fv.js +2 -0
  45. package/dist/chunk-5x5n3b15.js +2 -0
  46. package/dist/{chunk-fyxetwxv.js → chunk-64cbt3ym.js} +2 -2
  47. package/dist/{chunk-mvnze5ts.js → chunk-6e84zbgs.js} +2 -2
  48. package/dist/{chunk-rd9cgt8p.js → chunk-6ym1a5wa.js} +1 -1
  49. package/dist/{chunk-ma7thf1j.js → chunk-747qe35q.js} +1 -1
  50. package/dist/{chunk-ry7bxdb6.js → chunk-75dr7tyz.js} +2 -2
  51. package/dist/{chunk-18xfysvb.js → chunk-7ng6qs9c.js} +1 -1
  52. package/dist/{chunk-6f06hbsk.js → chunk-7rtwekkz.js} +2 -2
  53. package/dist/{chunk-91kpcajz.js → chunk-7s7cevjh.js} +2 -2
  54. package/dist/chunk-7zww33h8.js +2 -0
  55. package/dist/{chunk-byvw0vam.js → chunk-81838qem.js} +2 -2
  56. package/dist/{chunk-ar1bwfn3.js → chunk-84ncszbf.js} +1 -1
  57. package/dist/{chunk-952vsa4r.js → chunk-8gt8yn8k.js} +2 -2
  58. package/dist/{chunk-hyhp5ytm.js → chunk-8wk3e4z7.js} +2 -2
  59. package/dist/{chunk-6bbtfd0j.js → chunk-94m77zyn.js} +1 -1
  60. package/dist/{chunk-d0s10qy5.js → chunk-95ywdfe0.js} +2 -2
  61. package/dist/chunk-9nbkggqn.js +2 -0
  62. package/dist/chunk-9neb2f30.js +2 -0
  63. package/dist/{chunk-a6ns5agq.js → chunk-9wc4emwt.js} +2 -2
  64. package/dist/chunk-a11wvd8e.js +2 -0
  65. package/dist/{chunk-n32wra9r.js → chunk-acf4sdp7.js} +2 -2
  66. package/dist/{chunk-89j37t04.js → chunk-ag2t01q7.js} +2 -2
  67. package/dist/{chunk-yn6a84c7.js → chunk-aht6f6tf.js} +2 -2
  68. package/dist/{chunk-x1aw1r1v.js → chunk-amf0m4tb.js} +2 -2
  69. package/dist/{chunk-e3bpr3yx.js → chunk-axvjn527.js} +2 -2
  70. package/dist/{chunk-4t0f01ec.js → chunk-b2n5sj31.js} +1 -1
  71. package/dist/chunk-bapn03er.js +2 -0
  72. package/dist/{chunk-jn8b4qrh.js → chunk-bbrx6m7n.js} +2 -2
  73. package/dist/{chunk-m799f2x5.js → chunk-bztkz3dz.js} +2 -2
  74. package/dist/{chunk-h82jte5p.js → chunk-bzzx1y15.js} +2 -2
  75. package/dist/{chunk-gttw4rmx.js → chunk-c22xq7a3.js} +2 -2
  76. package/dist/{chunk-tcp7c2s0.js → chunk-c7qzvt21.js} +3 -3
  77. package/dist/chunk-cans04tz.js +3 -0
  78. package/dist/{chunk-4gftpery.js → chunk-cgnzqmqd.js} +2 -2
  79. package/dist/{chunk-c2ez86jz.js → chunk-chn1mkv0.js} +1 -1
  80. package/dist/{chunk-z76as4dt.js → chunk-cp4wxmh5.js} +1 -1
  81. package/dist/chunk-cv0qbty5.js +3 -0
  82. package/dist/{chunk-0jj029k8.js → chunk-d582db8v.js} +2 -2
  83. package/dist/{chunk-pw22g3k1.js → chunk-d71nz1je.js} +2 -2
  84. package/dist/{chunk-jzbg0cx9.js → chunk-dd9k5bbt.js} +2 -2
  85. package/dist/{chunk-xvg3d2z6.js → chunk-dx5hh359.js} +2 -2
  86. package/dist/{chunk-7m83dwzq.js → chunk-e3nccytb.js} +1 -1
  87. package/dist/{chunk-ee7a5gft.js → chunk-e9nvbe3j.js} +1 -1
  88. package/dist/{chunk-zxfx7psd.js → chunk-ermc9p1p.js} +2 -2
  89. package/dist/{chunk-w63mha8c.js → chunk-erp1g3as.js} +2 -2
  90. package/dist/{chunk-jy0jrht0.js → chunk-exrd2xzz.js} +2 -2
  91. package/dist/{chunk-e13mpwt8.js → chunk-eynwjzqp.js} +2 -2
  92. package/dist/{chunk-zj7kjjdj.js → chunk-fnm2xznx.js} +1 -1
  93. package/dist/{chunk-j1frpcqd.js → chunk-fwb6tf7m.js} +2 -2
  94. package/dist/{chunk-3q2zdv9e.js → chunk-g1tbd3pd.js} +1 -1
  95. package/dist/{chunk-8f5w2tnp.js → chunk-g3y0r56h.js} +1 -1
  96. package/dist/{chunk-gxb9n7g7.js → chunk-gbsn1qep.js} +3 -3
  97. package/dist/{chunk-yq4wz4n8.js → chunk-gjtxked2.js} +2 -2
  98. package/dist/{chunk-n7y094nf.js → chunk-grfrfh7s.js} +1 -1
  99. package/dist/chunk-h1kvdf3t.js +2 -0
  100. package/dist/{chunk-wk26bzjj.js → chunk-h3mwzf3d.js} +2 -2
  101. package/dist/{chunk-bve6cykn.js → chunk-hd11bfmp.js} +2 -2
  102. package/dist/{chunk-5c42mfat.js → chunk-hf5bpahd.js} +1 -1
  103. package/dist/{chunk-m0r0v983.js → chunk-j2ffde9c.js} +2 -2
  104. package/dist/{chunk-z107z7dt.js → chunk-j4w2hbbe.js} +2 -2
  105. package/dist/{chunk-nfwa8qkt.js → chunk-j62heyzq.js} +1 -1
  106. package/dist/{chunk-snrbgnwn.js → chunk-j8zpjnf8.js} +2 -2
  107. package/dist/{chunk-er7ewrf2.js → chunk-jdwd4ta9.js} +3 -3
  108. package/dist/{chunk-3zsqg6wr.js → chunk-je27hf3t.js} +3 -3
  109. package/dist/{chunk-2rbaebnr.js → chunk-jmc7ddz8.js} +2 -2
  110. package/dist/{chunk-ja7x2gvb.js → chunk-jvy6p83k.js} +1 -1
  111. package/dist/{chunk-0a7vp0ph.js → chunk-knrc6kks.js} +2 -2
  112. package/dist/{chunk-8qszap2n.js → chunk-kqwfwck2.js} +1 -1
  113. package/dist/{chunk-beccgzp9.js → chunk-m2n6sxf8.js} +2 -2
  114. package/dist/{chunk-2kbp0pbe.js → chunk-m68t534g.js} +2 -2
  115. package/dist/{chunk-b6sfe0k7.js → chunk-ma6ycen5.js} +2 -2
  116. package/dist/{chunk-gxx5yh45.js → chunk-mckz9qv5.js} +1 -1
  117. package/dist/{chunk-xx7t8r87.js → chunk-mfmh7ztq.js} +2 -2
  118. package/dist/{chunk-bcdmjgab.js → chunk-n4wp3h3j.js} +1 -1
  119. package/dist/{chunk-j5dqww4h.js → chunk-njqan8zg.js} +1 -1
  120. package/dist/{chunk-xpfy5g6z.js → chunk-p96vgnxw.js} +1 -1
  121. package/dist/{chunk-r940xwxq.js → chunk-pebkk426.js} +2 -2
  122. package/dist/{chunk-9w1vcmbd.js → chunk-pg9gckmw.js} +2 -2
  123. package/dist/chunk-ps408sxd.js +2 -0
  124. package/dist/{chunk-809b75k1.js → chunk-q3s59jyn.js} +2 -2
  125. package/dist/{chunk-zgqrv879.js → chunk-qa9p0a64.js} +3 -3
  126. package/dist/{chunk-113maskf.js → chunk-qceex4vv.js} +2 -2
  127. package/dist/chunk-qkn0y5wx.js +2 -0
  128. package/dist/{chunk-nwyem2d7.js → chunk-qzerhkyb.js} +2 -2
  129. package/dist/{chunk-c06k7g9n.js → chunk-qzn6qtmy.js} +1 -1
  130. package/dist/{chunk-44r55va6.js → chunk-r5f77gtx.js} +2 -2
  131. package/dist/{chunk-6p4gk1zy.js → chunk-rkwq0grt.js} +2 -2
  132. package/dist/{chunk-hmy4snze.js → chunk-rn54592t.js} +1 -1
  133. package/dist/{chunk-sn3sk1j0.js → chunk-s8cj6aw6.js} +1 -1
  134. package/dist/{chunk-ert67qk1.js → chunk-syjt7y4v.js} +2 -2
  135. package/dist/{chunk-2wfgbxet.js → chunk-t9t53gsj.js} +1 -1
  136. package/dist/{chunk-sxz82jq3.js → chunk-tgnftxyb.js} +2 -2
  137. package/dist/{chunk-51x80v4h.js → chunk-tr0bmqn9.js} +2 -2
  138. package/dist/{chunk-f54k9xxv.js → chunk-v0wmy9b3.js} +1 -1
  139. package/dist/{chunk-0j5z842s.js → chunk-v2pa8yak.js} +2 -2
  140. package/dist/{chunk-wm6zdp7w.js → chunk-v32jvbgx.js} +1 -1
  141. package/dist/{chunk-myjsfbp6.js → chunk-v96vkrw2.js} +2 -2
  142. package/dist/{chunk-ad53zbdb.js → chunk-v9weanq6.js} +2 -2
  143. package/dist/{chunk-621eg04b.js → chunk-vd6eqshg.js} +1 -1
  144. package/dist/{chunk-0s2zcz5f.js → chunk-vdt7cp6c.js} +2 -2
  145. package/dist/{chunk-j2k2mc13.js → chunk-vmfhnkxj.js} +1 -1
  146. package/dist/{chunk-na6b1fpn.js → chunk-vqby71fp.js} +1 -1
  147. package/dist/{chunk-dnrcx75n.js → chunk-vzgn8exd.js} +1 -1
  148. package/dist/{chunk-vyzq2pbd.js → chunk-w562jf57.js} +1 -1
  149. package/dist/{chunk-yj42tq3z.js → chunk-w5zvy4ex.js} +1 -1
  150. package/dist/{chunk-3qy743j9.js → chunk-wde0m4pf.js} +3 -3
  151. package/dist/{chunk-khs8cfkd.js → chunk-why9g2kd.js} +1 -1
  152. package/dist/{chunk-vhxavb92.js → chunk-xe7ep70k.js} +1 -1
  153. package/dist/{chunk-cq3j51m2.js → chunk-xnbvdqnt.js} +2 -2
  154. package/dist/{chunk-7jk8s061.js → chunk-xwwjj45a.js} +2 -2
  155. package/dist/{chunk-q1kb5z75.js → chunk-y4tj08c1.js} +1 -1
  156. package/dist/chunk-y8gz9rsc.js +2 -0
  157. package/dist/{chunk-e8p4wkbg.js → chunk-y8yawx3d.js} +1 -1
  158. package/dist/{chunk-bw3bpr6m.js → chunk-ypdh88cj.js} +2 -2
  159. package/dist/{chunk-dba0ttve.js → chunk-z6dx6dnt.js} +1 -1
  160. package/dist/chunk-zm0j9nw3.js +2 -0
  161. package/dist/{chunk-2w4kyd2a.js → chunk-zw4ehzza.js} +3 -3
  162. package/dist/{chunk-vnwt4f99.js → chunk-zypgrbd9.js} +1 -1
  163. package/dist/chunk-zzz6kmh8.js +2 -0
  164. package/dist/client.d.ts +1 -1
  165. package/dist/client.js +1 -1
  166. package/dist/codex/activity-group.js +1 -1
  167. package/dist/codex/artifact-links.js +1 -1
  168. package/dist/codex/assistant-message.js +1 -1
  169. package/dist/codex/async-question-card.js +1 -1
  170. package/dist/codex/edited-files-card.js +1 -1
  171. package/dist/codex/image-view-activity.js +1 -1
  172. package/dist/codex/markdown-renderer.js +1 -1
  173. package/dist/codex/patch-view.js +1 -1
  174. package/dist/codex/timeline-virtualizer.js +1 -1
  175. package/dist/codex/user-message.js +1 -1
  176. package/dist/codex/virtualized-turn-list.js +1 -1
  177. package/dist/collections/collection-emoji.js +1 -1
  178. package/dist/collections/collection-menu.js +1 -1
  179. package/dist/collections/collection-panel.js +1 -1
  180. package/dist/collections/collections.js +1 -1
  181. package/dist/collections/host.js +1 -1
  182. package/dist/collections/store.js +1 -1
  183. package/dist/composer/completion-filter.js +1 -1
  184. package/dist/composer/completion-menu.js +1 -1
  185. package/dist/composer/effort-slider.js +1 -1
  186. package/dist/composer/inline-document.js +1 -1
  187. package/dist/composer/inline-dom.js +1 -1
  188. package/dist/composer/model-select.js +1 -1
  189. package/dist/composer/prompt-input-attachments.js +1 -1
  190. package/dist/composer/prompt-input-clipboard.js +1 -1
  191. package/dist/composer/prompt-input-context.js +1 -1
  192. package/dist/composer/prompt-input-inline.js +1 -1
  193. package/dist/composer/prompt-input-textarea.js +1 -1
  194. package/dist/composer/prompt-input.js +1 -1
  195. package/dist/conversation/action-card.js +1 -1
  196. package/dist/conversation/composer/app-mentions.js +1 -1
  197. package/dist/conversation/composer/apps-menu.js +1 -1
  198. package/dist/conversation/composer/composer-menu.js +1 -1
  199. package/dist/conversation/composer/composer.js +1 -1
  200. package/dist/conversation/composer/context.js +1 -1
  201. package/dist/conversation/composer/drafts.js +1 -1
  202. package/dist/conversation/composer/long-text.js +1 -1
  203. package/dist/conversation/composer/mention-chips.js +1 -1
  204. package/dist/conversation/composer/model-menu.js +1 -1
  205. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  206. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  207. package/dist/conversation/composer/prompt-history.js +1 -1
  208. package/dist/conversation/composer/slash-command-button.js +1 -1
  209. package/dist/conversation/composer/submit-button.js +1 -1
  210. package/dist/conversation/composer/usage-meter.js +1 -1
  211. package/dist/conversation/connection-notice.js +1 -1
  212. package/dist/conversation/context.js +1 -1
  213. package/dist/conversation/conversation-body.js +1 -1
  214. package/dist/conversation/conversation-search.js +1 -1
  215. package/dist/conversation/conversation-view.js +1 -1
  216. package/dist/conversation/conversation.js +1 -1
  217. package/dist/conversation/diff-modal.js +1 -1
  218. package/dist/conversation/draft-project-picker.js +1 -1
  219. package/dist/conversation/session-actions.js +1 -1
  220. package/dist/conversation/subagent-sessions.js +1 -1
  221. package/dist/conversation/subagent-tasks.js +1 -1
  222. package/dist/desktop/desktop-composer.js +1 -1
  223. package/dist/desktop/desktop.js +1 -1
  224. package/dist/desktop/draft-model-select.js +1 -1
  225. package/dist/desktop/load-image.js +1 -1
  226. package/dist/desktop/model-catalog.js +1 -1
  227. package/dist/desktop/model-recovery.js +1 -1
  228. package/dist/desktop/model-settings-action.js +1 -1
  229. package/dist/desktop/native-file-drop.js +1 -1
  230. package/dist/generated/commands.js +1 -1
  231. package/dist/image.d.ts +20 -21
  232. package/dist/image.js +1 -1
  233. package/dist/lib/app-reference.js +1 -1
  234. package/dist/lib/application-metadata.js +1 -1
  235. package/dist/lib/chat-path.js +1 -1
  236. package/dist/lib/fuzzy.js +1 -1
  237. package/dist/lib/markdown-parser.js +1 -1
  238. package/dist/lib/markdown-rules.js +1 -1
  239. package/dist/lib/model-name.js +1 -1
  240. package/dist/lib/streaming-markdown.js +1 -1
  241. package/dist/mermaid/diagram.js +1 -1
  242. package/dist/mermaid/export.js +1 -1
  243. package/dist/mermaid/index.js +1 -1
  244. package/dist/oauth/claude-login.js +1 -1
  245. package/dist/oauth.js +1 -1
  246. package/dist/plugins/catalog-skeleton.js +1 -1
  247. package/dist/plugins/host.js +1 -1
  248. package/dist/plugins/plugin-detail-page.js +1 -1
  249. package/dist/plugins/plugin-icon.js +1 -1
  250. package/dist/plugins/plugin-icons.js +1 -1
  251. package/dist/plugins/plugins-page.js +1 -1
  252. package/dist/plugins/plugins.js +1 -1
  253. package/dist/plugins/read-skill-document.js +1 -1
  254. package/dist/plugins/skill-document.js +1 -1
  255. package/dist/plugins/skills-tab.js +1 -1
  256. package/dist/plugins/store.js +1 -1
  257. package/dist/reference-projection.js +1 -1
  258. package/dist/search/chat-search.js +1 -1
  259. package/dist/search/codex-source-matches.js +1 -1
  260. package/dist/search/dom-matches.js +1 -1
  261. package/dist/search/literal-matches.js +1 -1
  262. package/dist/session-list/account-menu.js +1 -1
  263. package/dist/session-list/activity-list.js +1 -1
  264. package/dist/session-list/archived-sessions.js +1 -1
  265. package/dist/session-list/help-menu.js +1 -1
  266. package/dist/session-list/host.js +1 -1
  267. package/dist/session-list/navigation-controls.js +1 -1
  268. package/dist/session-list/navigation-header.js +1 -1
  269. package/dist/session-list/navigation-store.js +1 -1
  270. package/dist/session-list/navigation.js +1 -1
  271. package/dist/session-list/platform.js +1 -1
  272. package/dist/session-list/session-info-card.js +1 -1
  273. package/dist/session-list/session-list.js +1 -1
  274. package/dist/session-list/session-row.js +1 -1
  275. package/dist/session-list/session-state-dot.js +1 -1
  276. package/dist/session-list/session-state-menu.js +1 -1
  277. package/dist/session-list/shortcut-hint.js +1 -1
  278. package/dist/session-list/shortcut.js +1 -1
  279. package/dist/session-list/sidebar-overlay.js +1 -1
  280. package/dist/session-list/use-activity-notification.js +1 -1
  281. package/dist/session-list/use-activity-preview.js +1 -1
  282. package/dist/session-list/use-cmd-held.js +1 -1
  283. package/dist/session-list/use-project-sessions.js +1 -1
  284. package/dist/session-list/virtual-session-rows.js +1 -1
  285. package/dist/session-timeline/activity-group.js +1 -1
  286. package/dist/session-timeline/activity-projection.js +1 -1
  287. package/dist/session-timeline/assistant-content.js +1 -1
  288. package/dist/session-timeline/assistant-image-references.js +1 -1
  289. package/dist/session-timeline/assistant-turn.js +1 -1
  290. package/dist/session-timeline/async-questions.js +1 -1
  291. package/dist/session-timeline/edited-files-card.js +1 -1
  292. package/dist/session-timeline/host.js +1 -1
  293. package/dist/session-timeline/image-generation-progress.js +1 -1
  294. package/dist/session-timeline/navigation-rail.js +1 -1
  295. package/dist/session-timeline/resource-content.js +1 -1
  296. package/dist/session-timeline/session-timeline.js +1 -1
  297. package/dist/session-timeline/turn-error.js +1 -1
  298. package/dist/session-timeline/turns.js +1 -1
  299. package/dist/session-timeline/user-message.js +1 -1
  300. package/dist/settings/codex-account-card.js +1 -1
  301. package/dist/settings/login-card.js +1 -1
  302. package/dist/settings/model-alias-settings.js +1 -1
  303. package/dist/settings/provider-logos.js +1 -1
  304. package/dist/settings/provider-section.js +1 -1
  305. package/dist/settings/providers-port.js +1 -1
  306. package/dist/settings/providers.js +1 -1
  307. package/dist/settings/settings.js +1 -1
  308. package/native/win32-x64/alwith_native_chat.dll +0 -0
  309. package/native/win32-x64/artifact.json +1 -1
  310. package/package.json +4 -3
  311. package/dist/chunk-4cr144a7.js +0 -2
  312. package/dist/chunk-4e622bdk.js +0 -3
  313. package/dist/chunk-6qxd4jg9.js +0 -2
  314. package/dist/chunk-6z3fgkkp.js +0 -2
  315. package/dist/chunk-an3nh155.js +0 -2
  316. package/dist/chunk-bw1m6407.js +0 -2
  317. package/dist/chunk-d0nrbf80.js +0 -2
  318. package/dist/chunk-f7d0hs1y.js +0 -2
  319. package/dist/chunk-jv327stj.js +0 -2
  320. package/dist/chunk-kbax1frf.js +0 -2
  321. package/dist/chunk-n6erf29r.js +0 -2
  322. package/dist/chunk-q7jm6srr.js +0 -2
  323. package/dist/chunk-rragk2vb.js +0 -2
  324. package/dist/chunk-sqkdenb0.js +0 -3
  325. package/dist/chunk-stse5bdv.js +0 -2
  326. package/dist/chunk-tc80kegm.js +0 -2
  327. package/dist/chunk-ytdhstqx.js +0 -2
  328. package/dist/chunk-zxkpemh4.js +0 -2
package/README.md CHANGED
@@ -404,24 +404,23 @@ Applications import protocol clients and session projections from `@alwith/modul
404
404
  ### Application tools
405
405
 
406
406
  Pass `applicationTools` to `CodexClient` from `@alwith/module-chat/client`. Each
407
- application owns its capabilities and data; the client owns declaration, session
408
- binding, permission matching, dispatch, cancellation and error responses.
407
+ application owns its capabilities and data; the client serves them to its own
408
+ sessions as a standard MCP server over the ACP connection
409
+ ([MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp)).
409
410
 
410
411
  ```ts
411
412
  const readCount = defineApplicationTool({
412
413
  name: "read_count",
413
414
  description: "Read the current item count",
414
- revision: "1",
415
415
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
416
+ annotations: { readOnlyHint: true },
416
417
  parse(input: unknown) {
417
418
  if (!input || typeof input !== "object" || Array.isArray(input) || Object.keys(input).length)
418
419
  throw new Error("Expected an empty object")
419
420
  return undefined
420
421
  },
421
- autoApprove: () => true,
422
422
  execute: async (_input, { sessionId, signal }) => ({
423
- success: true,
424
- contentItems: [{ type: "text", text: String(await readCountForSession(sessionId, signal)) }]
423
+ content: [{ type: "text", text: String(await readCountForSession(sessionId, signal)) }]
425
424
  })
426
425
  })
427
426
  const client = new CodexClient(openPort, {
@@ -433,36 +432,29 @@ const client = new CodexClient(openPort, {
433
432
 
434
433
  `defineApplicationTool` runs the supplied parser before executing the handler and
435
434
  preserves its argument type. `inputSchema` describes the same arguments to the
436
- model; the parser enforces their business constraints. Results use the existing
437
- `ClientToolResult` contract from `@alwith/api/tools`.
435
+ model; the parser enforces their business constraints. Results are MCP
436
+ `CallToolResult`s; a thrown error becomes a result with `isError`, which the model
437
+ can read and recover from.
438
438
 
439
439
  A selector can replace the array: `applicationTools: ({ cwd, operation, options }) => tools`.
440
- It runs for new, restored and forked sessions. The client snapshots each selection
441
- and rejects duplicate names, unavailable tools and stale revisions. Increment a
442
- tool's `revision` when its definition or execution contract changes. The selected
443
- set remains stable until the session is explicitly rebound; input controls and
444
- the currently selected conversation do not change a binding. Subclasses can
445
- compose the default selection through `applicationToolsFor`.
446
-
447
- Omit `autoApprove` to use the normal permission UI. Automatic approval requires
448
- adapter-provided `_meta.alwith.tool` identity matching the registered name and
449
- set revision. Adapters without permission metadata are matched through the standard
450
- ACP tool name and call ID in the same session's live, unfinished tool event. History,
451
- restoring sessions, stale metadata, descriptions and translated titles cannot grant
452
- approval. Identity checks read the current session projection rather than a delayed
453
- UI snapshot. Tools without a matching identity continue through the normal permission UI.
454
- A skill's enabled state does not grant permission to execute a tool.
455
-
456
- Handlers receive `sessionId`, `turnId`, `toolCallId`, `agent` and `signal`. Pass the signal to
457
- external operations and check it before applying changes. Session cancellation,
458
- close, stop, rebinding, disconnection and individual `$/cancel_request` withdrawal
459
- abort active calls; late results are discarded. Cancellation cannot undo a side
460
- effect that already completed. Pending calls from an earlier client attachment
461
- are not replayed. Runtime and the adapter continue to own processes and turns.
462
-
463
- Applications that already declare raw `_meta.alwith.tools` and handle their own
464
- calls remain supported. Do not combine raw declarations with registered tools in
465
- the same session. New integrations should use the registry above.
440
+ It runs for new, restored and forked sessions; a session's own tools can also be
441
+ passed as `applicationTools` in its request options. Each session request declares
442
+ one `"type": "acp"` server named `alwith` with the selected tools, and the agent
443
+ replaces the session's previous declaration with it. Subclasses can compose the
444
+ default selection through `applicationToolsFor`. The agent must advertise
445
+ `session.mcp.acp`; selecting tools for one that does not is an error.
446
+
447
+ Approval belongs to the agent and its mode, as for any MCP server. Annotate tools
448
+ truthfully: Codex runs a tool without asking when `readOnlyHint` is true, and asks
449
+ when `destructiveHint` or `openWorldHint` is true (both default to true).
450
+
451
+ Handlers receive `sessionId`, `turnId`, `toolCallId`, `agent` and `signal`. Pass the
452
+ signal to external operations and check it before applying changes. Session
453
+ cancellation, close, stop, rebinding, disconnection and the agent's
454
+ `$/cancel_request` abort active calls, which are then answered as cancelled.
455
+ Cancellation cannot undo a side effect that already completed. Pending calls from
456
+ an earlier client attachment are not replayed. Runtime and the adapter continue to
457
+ own processes and turns.
466
458
 
467
459
  ### Existing Claude login (Bun host only)
468
460
 
@@ -1 +1 @@
1
- import{b,Ui}from"../chunk-kbax1frf.js";import"../chunk-ad53zbdb.js";import"../chunk-e13mpwt8.js";import"../chunk-q7jm6srr.js";import"../chunk-x8rfc6wc.js";import"../chunk-jn8b4qrh.js";import"../chunk-7tw7rn0m.js";import"../chunk-nrpgmawz.js";import"../chunk-bw3bpr6m.js";import"../chunk-621eg04b.js";import"../chunk-rd9cgt8p.js";import"../chunk-n6erf29r.js";import"../chunk-e1fzfaqj.js";import"../chunk-etvdqkvb.js";import"../chunk-6z3fgkkp.js";import"../chunk-rv3k0kfr.js";export{Ui as CodexClient,b as NATIVE_MODEL_GROUP};
1
+ import{b,Hi}from"../chunk-a11wvd8e.js";import"../chunk-v9weanq6.js";import"../chunk-eynwjzqp.js";import"../chunk-ps408sxd.js";import"../chunk-4sfxcw58.js";import"../chunk-bbrx6m7n.js";import"../chunk-7tw7rn0m.js";import"../chunk-nrpgmawz.js";import"../chunk-ypdh88cj.js";import"../chunk-vd6eqshg.js";import"../chunk-6ym1a5wa.js";import"../chunk-9neb2f30.js";import"../chunk-e1fzfaqj.js";import"../chunk-etvdqkvb.js";import"../chunk-2f8s5gtn.js";import"../chunk-rv3k0kfr.js";export{Hi as CodexClient,b as NATIVE_MODEL_GROUP};
@@ -1 +1 @@
1
- import{ao}from"../chunk-e13mpwt8.js";export{ao as customModelEffort};
1
+ import{so}from"../chunk-eynwjzqp.js";export{so as customModelEffort};
@@ -1 +1 @@
1
- import{zi,lo,Vi}from"../chunk-x8rfc6wc.js";export{zi as IMAGE_WORKFLOW_INSTRUCTIONS,Vi as imageGenerationPrompt,lo as imageRequestAspect};
1
+ import{Gi,ao,zi}from"../chunk-4sfxcw58.js";export{Gi as IMAGE_WORKFLOW_INSTRUCTIONS,zi as imageGenerationPrompt,ao as imageRequestAspect};
@@ -1 +1 @@
1
- import{Gi}from"../chunk-q7jm6srr.js";import"../chunk-x8rfc6wc.js";import"../chunk-n6erf29r.js";import"../chunk-6z3fgkkp.js";import"../chunk-rv3k0kfr.js";export{Gi as createImageTool};
1
+ import{Bi}from"../chunk-ps408sxd.js";import"../chunk-4sfxcw58.js";import"../chunk-9neb2f30.js";import"../chunk-2f8s5gtn.js";import"../chunk-rv3k0kfr.js";export{Bi as createImageTool};
@@ -1 +1 @@
1
- import{ji,Nn}from"../chunk-jn8b4qrh.js";export{ji as parseInputConfig,Nn as parseInputSnapshot};
1
+ import{Vi,Nn}from"../chunk-bbrx6m7n.js";export{Vi as parseInputConfig,Nn as parseInputSnapshot};
@@ -1 +1 @@
1
- import{co}from"../../chunk-bw3bpr6m.js";export{co as executionMeta};
1
+ import{lo}from"../../chunk-ypdh88cj.js";export{lo as executionMeta};
@@ -1 +1 @@
1
- import{fe}from"../../chunk-rd9cgt8p.js";import"../../chunk-n6erf29r.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{fe as imageInputMode};
1
+ import{fe}from"../../chunk-6ym1a5wa.js";import"../../chunk-9neb2f30.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{fe as imageInputMode};
@@ -1 +1 @@
1
- import{ot,Ge,va}from"../../chunk-621eg04b.js";import"../../chunk-rd9cgt8p.js";import"../../chunk-n6erf29r.js";import"../../chunk-e1fzfaqj.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{Ge as inputModeDefinition,ot as isInputMode,va as resolveInputMode};
1
+ import{ot,Ge,va}from"../../chunk-vd6eqshg.js";import"../../chunk-6ym1a5wa.js";import"../../chunk-9neb2f30.js";import"../../chunk-e1fzfaqj.js";import"../../chunk-etvdqkvb.js";import"../../chunk-rv3k0kfr.js";export{Ge as inputModeDefinition,ot as isInputMode,va as resolveInputMode};
@@ -1 +1 @@
1
- import{be}from"./chunk-7m83dwzq.js";import"./chunk-beccgzp9.js";import"./chunk-4vayk46h.js";export{be as AppReferenceBadge};
1
+ import{be}from"./chunk-e3nccytb.js";import"./chunk-m2n6sxf8.js";import"./chunk-4vayk46h.js";export{be as AppReferenceBadge};
@@ -1,6 +1,7 @@
1
+ import { type McpServer } from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
+ import { type CallToolResult, type ToolAnnotations } from "@modelcontextprotocol/server";
1
3
  import type { Agent, AgentRequest, Session, SessionOperation, SessionRequestOptions } from "@nyssance/codex-acp-v2/client";
2
- export type { ClientToolResult as ApplicationToolResult } from "@alwith/api/tools";
3
- import type { ClientToolResult as ApplicationToolResult, ClientToolSet } from "@alwith/api/tools";
4
+ export type ApplicationToolResult = CallToolResult;
4
5
  export type ApplicationToolContext = {
5
6
  sessionId: string;
6
7
  toolCallId: string;
@@ -10,10 +11,10 @@ export type ApplicationToolContext = {
10
11
  };
11
12
  export type ApplicationTool = {
12
13
  name: string;
14
+ title?: string;
13
15
  description: string;
14
16
  inputSchema: Record<string, unknown>;
15
- revision: string;
16
- autoApprove?: (sessionId: string) => boolean;
17
+ annotations?: ToolAnnotations;
17
18
  execute: (input: unknown, context: ApplicationToolContext) => Promise<ApplicationToolResult> | ApplicationToolResult;
18
19
  };
19
20
  export type ApplicationSessionOptions = SessionRequestOptions & {
@@ -25,21 +26,31 @@ export type ApplicationToolSelection = {
25
26
  options: ApplicationSessionOptions;
26
27
  };
27
28
  export type ApplicationTools = readonly ApplicationTool[] | ((selection: ApplicationToolSelection) => readonly ApplicationTool[] | Promise<readonly ApplicationTool[]>);
29
+ export type ApplicationCallIdentity = (meta: Record<string, unknown>) => {
30
+ toolCallId: string;
31
+ turnId: string;
32
+ };
28
33
  export declare function defineApplicationTool<T>(tool: Omit<ApplicationTool, "execute"> & {
29
34
  parse: (input: unknown) => T;
30
35
  execute: (input: T, context: ApplicationToolContext) => Promise<ApplicationToolResult> | ApplicationToolResult;
31
36
  }): ApplicationTool;
32
- export declare function applicationToolSet(tools: readonly ApplicationTool[]): ClientToolSet;
37
+ export declare const APPLICATION_SERVER_NAME = "alwith";
33
38
  export declare class ApplicationToolRegistry {
34
- private readonly sessions;
35
- private readonly calls;
39
+ private readonly servers;
40
+ private readonly requests;
36
41
  private readonly session;
37
- constructor(session: (id: string) => Session | undefined);
38
- bind(id: string, tools: readonly ApplicationTool[], revision: string): void;
39
- cancel(id: string): void;
40
- drop(id: string): void;
42
+ private readonly identity;
43
+ constructor(session: (id: string) => Session | undefined, identity: ApplicationCallIdentity);
44
+ declare(tools: readonly ApplicationTool[]): Extract<McpServer, {
45
+ type: "acp";
46
+ }>;
47
+ bind(serverId: string, sessionId: string): void;
48
+ cancel(sessionId: string): void;
49
+ drop(sessionId: string): void;
41
50
  clear(): void;
42
- private attached;
51
+ private dispose;
43
52
  withdraw(requestId: unknown): boolean;
44
53
  handle(agent: Agent, request: AgentRequest): boolean;
54
+ private message;
55
+ private server;
45
56
  }
@@ -1 +1 @@
1
- import{Rn,Ln,po}from"./chunk-6z3fgkkp.js";export{po as ApplicationToolRegistry,Ln as applicationToolSet,Rn as defineApplicationTool};
1
+ import{Rn,co,uo}from"./chunk-2f8s5gtn.js";export{co as APPLICATION_SERVER_NAME,uo as ApplicationToolRegistry,Rn as defineApplicationTool};
@@ -1 +1 @@
1
- import{bi,to,Ye,rn}from"../chunk-byvw0vam.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as A}from"cn";import{useCallback as T,useEffect as I,useLayoutEffect as L,useMemo as q,useRef as G,useState as C}from"react";import{createPortal as V}from"react-dom";import{Badge as W}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as H}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Input as M}from"@nyssance/shadcn/vega/components/ui/input";import{Label as O}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as K,RadioGroupItem as _}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Textarea as X}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as s,jsxs as d}from"react/jsx-runtime";var l="__other__";function de({current:n,total:U,anchorRef:x,t:u,onAccept:P,onDecline:Q}){let p=q(()=>n?bi(n.requestedSchema):[],[n]),[b,g]=C({}),S=G(null);I(()=>{if(n?.elicitationId===void 0)return;let e={};for(let{key:r,property:i}of p)if(!Ye(i)){let c=rn(i)[0];if(c)e[r]={selected:c.value}}g(e)},[n?.elicitationId,p]),I(()=>{if(n?.elicitationId!==void 0&&S.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")S.current.focus()},[n?.elicitationId]);let[w,R]=C(null),[k,z]=C(null),N=T(()=>{let e=x.current;if(!e)return;let r=e.getBoundingClientRect();if(r.width===0){let i=Math.min(640,window.innerWidth*0.9);R({left:(window.innerWidth-i)/2,width:i,bottom:24});return}R({left:r.left,width:r.width,bottom:window.innerHeight-r.bottom+20})},[x]);L(()=>{if(!n)return;let e=0,r=()=>{if(x.current){N();return}e=requestAnimationFrame(r)};return r(),()=>cancelAnimationFrame(e)},[n,N,x]),L(()=>{let e=x.current;if(!n||!e||!k)return;return j(e,k,N,{animationFrame:!0})},[n,k,x,N]);let y=q(()=>{if(!n)return!1;for(let{key:e,property:r}of p){let i=b[e];if(!i)return!1;if(Ye(r)){if(!i.selectedSet||i.selectedSet.size===0)return!1;if(i.selectedSet.has(l)&&!i.otherText?.trim())return!1}else{if(!i.selected)return!1;if(i.selected===l&&!i.otherText?.trim())return!1}}return!0},[n,p,b]),D=T(async()=>{if(!n)return;if(!y)return;let e={},r={};for(let{key:i,property:c}of p){let a=b[i];if(!a)continue;let f;if(Ye(c))e[i]=[...a.selectedSet??[]].map((m)=>m===l?(a.otherText??"").trim():m).filter(Boolean);else{let m=a.selected??"";if(e[i]=m===l?(a.otherText??"").trim():m,m!==l)f=rn(c).find((t)=>t.value===m)?.preview}let v=a.notes?.trim();if(f||v)r[i]={...f&&{preview:f},...v&&{notes:v}}}await P(n.elicitationId,e,r)},[n,p,b,y,P]),F=T(async()=>{if(n)await Q(n.elicitationId)},[n,Q]);if(!n||!w)return null;return V(d("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(e)=>{if(e.key==="Escape")e.preventDefault(),F()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:w.left,width:w.width,bottom:w.bottom,maxHeight:"70vh"},ref:(e)=>{S.current=e,z(e)},children:[d("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:u("askUserQuestion.title")}),U>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${U}`})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:p.map(({key:e,property:r},i)=>{let c=b[e],a=c?.selected,f=c?.selectedSet??new Set,v=rn(r),m=Ye(r);return d("div",{className:"space-y-2",children:[d("div",{className:"flex items-center gap-2",children:[s(W,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:to(r).title??e}),s("div",{className:"text-foreground text-sm font-medium",children:to(r).description})]}),m?d("div",{className:"space-y-1.5 ps-1",children:[v.map((t)=>d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(t.value),onCheckedChange:(o)=>{g((h)=>{let E=new Set(h[e]?.selectedSet??new Set);if(o)E.add(t.value);else E.delete(t.value);return{...h,[e]:{...h[e],selectedSet:E}}})}}),d("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs",children:t.description})]})]},t.value)),d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(l),onCheckedChange:(t)=>{g((o)=>{let h=new Set(o[e]?.selectedSet??new Set);if(t)h.add(l);else h.delete(l);return{...o,[e]:{...o[e],selectedSet:h}}})}}),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:u("askUserQuestion.other")})]}),f.has(l)&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}):d(K,{value:a??"",onValueChange:(t)=>g((o)=>({...o,[e]:{...o[e],selected:t}})),className:"space-y-1.5 ps-1",children:[v.map((t)=>{let o=`${i}:${t.value}`;return d("div",{className:A("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",a===t.value&&"bg-muted/60"),children:[s(_,{value:t.value,id:o}),d(O,{htmlFor:o,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:t.description})]})]},t.value)}),d("div",{className:A("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",a===l&&"bg-muted/60"),children:[s(_,{value:l,id:`${i}:other`,className:"mt-0.5"}),s(O,{htmlFor:`${i}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:u("askUserQuestion.other")})]}),a===l&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}),!m&&a&&a!==l&&(()=>{let t=v.find((o)=>o.value===a)?.preview;if(!t)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:t})})(),v.some((t)=>t.preview)&&s(X,{placeholder:u("askUserQuestion.notesPlaceholder"),value:c?.notes??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],notes:t.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},e)})})}),d("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(B,{variant:"ghost",size:"sm",onClick:()=>void F(),children:u("askUserQuestion.cancel")}),s(B,{size:"sm",disabled:!y,onClick:()=>void D(),children:u("askUserQuestion.submit")})]})]}),document.body)}export{de as ChoiceElicitationForm};
1
+ import{xi,eo,Ye,rn}from"../chunk-81838qem.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as A}from"cn";import{useCallback as T,useEffect as I,useLayoutEffect as L,useMemo as q,useRef as G,useState as C}from"react";import{createPortal as V}from"react-dom";import{Badge as W}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as H}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Input as M}from"@nyssance/shadcn/vega/components/ui/input";import{Label as O}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as K,RadioGroupItem as _}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Textarea as X}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as s,jsxs as d}from"react/jsx-runtime";var l="__other__";function de({current:n,total:U,anchorRef:x,t:u,onAccept:P,onDecline:Q}){let p=q(()=>n?xi(n.requestedSchema):[],[n]),[b,g]=C({}),S=G(null);I(()=>{if(n?.elicitationId===void 0)return;let e={};for(let{key:r,property:i}of p)if(!Ye(i)){let c=rn(i)[0];if(c)e[r]={selected:c.value}}g(e)},[n?.elicitationId,p]),I(()=>{if(n?.elicitationId!==void 0&&S.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")S.current.focus()},[n?.elicitationId]);let[w,R]=C(null),[k,z]=C(null),N=T(()=>{let e=x.current;if(!e)return;let r=e.getBoundingClientRect();if(r.width===0){let i=Math.min(640,window.innerWidth*0.9);R({left:(window.innerWidth-i)/2,width:i,bottom:24});return}R({left:r.left,width:r.width,bottom:window.innerHeight-r.bottom+20})},[x]);L(()=>{if(!n)return;let e=0,r=()=>{if(x.current){N();return}e=requestAnimationFrame(r)};return r(),()=>cancelAnimationFrame(e)},[n,N,x]),L(()=>{let e=x.current;if(!n||!e||!k)return;return j(e,k,N,{animationFrame:!0})},[n,k,x,N]);let y=q(()=>{if(!n)return!1;for(let{key:e,property:r}of p){let i=b[e];if(!i)return!1;if(Ye(r)){if(!i.selectedSet||i.selectedSet.size===0)return!1;if(i.selectedSet.has(l)&&!i.otherText?.trim())return!1}else{if(!i.selected)return!1;if(i.selected===l&&!i.otherText?.trim())return!1}}return!0},[n,p,b]),D=T(async()=>{if(!n)return;if(!y)return;let e={},r={};for(let{key:i,property:c}of p){let a=b[i];if(!a)continue;let f;if(Ye(c))e[i]=[...a.selectedSet??[]].map((m)=>m===l?(a.otherText??"").trim():m).filter(Boolean);else{let m=a.selected??"";if(e[i]=m===l?(a.otherText??"").trim():m,m!==l)f=rn(c).find((t)=>t.value===m)?.preview}let v=a.notes?.trim();if(f||v)r[i]={...f&&{preview:f},...v&&{notes:v}}}await P(n.elicitationId,e,r)},[n,p,b,y,P]),F=T(async()=>{if(n)await Q(n.elicitationId)},[n,Q]);if(!n||!w)return null;return V(d("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(e)=>{if(e.key==="Escape")e.preventDefault(),F()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:w.left,width:w.width,bottom:w.bottom,maxHeight:"70vh"},ref:(e)=>{S.current=e,z(e)},children:[d("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:u("askUserQuestion.title")}),U>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${U}`})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:p.map(({key:e,property:r},i)=>{let c=b[e],a=c?.selected,f=c?.selectedSet??new Set,v=rn(r),m=Ye(r);return d("div",{className:"space-y-2",children:[d("div",{className:"flex items-center gap-2",children:[s(W,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:eo(r).title??e}),s("div",{className:"text-foreground text-sm font-medium",children:eo(r).description})]}),m?d("div",{className:"space-y-1.5 ps-1",children:[v.map((t)=>d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(t.value),onCheckedChange:(o)=>{g((h)=>{let E=new Set(h[e]?.selectedSet??new Set);if(o)E.add(t.value);else E.delete(t.value);return{...h,[e]:{...h[e],selectedSet:E}}})}}),d("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs",children:t.description})]})]},t.value)),d("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(H,{checked:f.has(l),onCheckedChange:(t)=>{g((o)=>{let h=new Set(o[e]?.selectedSet??new Set);if(t)h.add(l);else h.delete(l);return{...o,[e]:{...o[e],selectedSet:h}}})}}),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:u("askUserQuestion.other")})]}),f.has(l)&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}):d(K,{value:a??"",onValueChange:(t)=>g((o)=>({...o,[e]:{...o[e],selected:t}})),className:"space-y-1.5 ps-1",children:[v.map((t)=>{let o=`${i}:${t.value}`;return d("div",{className:A("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",a===t.value&&"bg-muted/60"),children:[s(_,{value:t.value,id:o}),d(O,{htmlFor:o,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:t.label}),t.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:t.description})]})]},t.value)}),d("div",{className:A("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",a===l&&"bg-muted/60"),children:[s(_,{value:l,id:`${i}:other`,className:"mt-0.5"}),s(O,{htmlFor:`${i}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:u("askUserQuestion.other")})]}),a===l&&s("div",{className:"ps-7",children:s(M,{placeholder:u("askUserQuestion.otherPlaceholder"),value:c?.otherText??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],otherText:t.target.value}}))})})]}),!m&&a&&a!==l&&(()=>{let t=v.find((o)=>o.value===a)?.preview;if(!t)return null;return s("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:t})})(),v.some((t)=>t.preview)&&s(X,{placeholder:u("askUserQuestion.notesPlaceholder"),value:c?.notes??"",onChange:(t)=>g((o)=>({...o,[e]:{...o[e],notes:t.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},e)})})}),d("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(B,{variant:"ghost",size:"sm",onClick:()=>void F(),children:u("askUserQuestion.cancel")}),s(B,{size:"sm",disabled:!y,onClick:()=>void D(),children:u("askUserQuestion.submit")})]})]}),document.body)}export{de as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{bi,to,Ye,rn}from"../chunk-byvw0vam.js";export{bi as elicitationFields,to as elicitationLabels,rn as elicitationOptions,Ye as isMultiSelect};
1
+ import{xi,eo,Ye,rn}from"../chunk-81838qem.js";export{xi as elicitationFields,eo as elicitationLabels,rn as elicitationOptions,Ye as isMultiSelect};
@@ -1 +1 @@
1
- import{aa,_i,ja,$a}from"../chunk-q9b2wsdg.js";export{aa as PERMISSION_KIND_GROUP_ORDER,ja as isAllowKind,$a as isAlwaysKind,_i as sortPermissionOptions};
1
+ import{aa,Si,ja,$a}from"../chunk-2bbdgf43.js";export{aa as PERMISSION_KIND_GROUP_ORDER,ja as isAllowKind,$a as isAlwaysKind,Si as sortPermissionOptions};
@@ -1 +1 @@
1
- import{ki}from"../chunk-0s2zcz5f.js";import"../chunk-q9b2wsdg.js";export{ki as PermissionView};
1
+ import{wi}from"../chunk-vdt7cp6c.js";import"../chunk-2bbdgf43.js";export{wi as PermissionView};
@@ -1 +1 @@
1
- import{Pa,la,Ia,Pi}from"../chunk-809b75k1.js";export{Pi as SchemaElicitationForm,Pa as elicitationFields,la as initialValues,Ia as isAnswered};
1
+ import{Pa,la,Ia,_i}from"../chunk-q3s59jyn.js";export{_i as SchemaElicitationForm,Pa as elicitationFields,la as initialValues,Ia as isAnswered};
@@ -1 +1 @@
1
- import{Si}from"../chunk-x2wcwpw3.js";export{Si as UrlElicitationCard};
1
+ import{ki}from"../chunk-1wr1ef9x.js";export{ki as UrlElicitationCard};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-n32wra9r.js";import{Xt,Yt}from"./chunk-bgnxw313.js";import{S}from"./chunk-c2r7xpjf.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Zs({providers:n,store:l}){let{t:m}=e().host,d=Xt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=S(s.id,o.api_id);return t(w,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function w({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Yt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
1
+ import{e}from"./chunk-acf4sdp7.js";import{Xt,Yt}from"./chunk-bgnxw313.js";import{S}from"./chunk-3z86hy2s.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Zs({providers:n,store:l}){let{t:m}=e().host,d=Xt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=S(s.id,o.api_id);return t(w,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function w({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Yt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
2
  export{Zs};
@@ -1,2 +1,2 @@
1
- var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function go(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function St(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=go(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
- export{go,St};
1
+ var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function mo(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function St(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=mo(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
+ export{mo,St};
@@ -1,2 +1,2 @@
1
- import{G}from"./chunk-jp4xjks0.js";import{Ee}from"./chunk-c2ez86jz.js";import{A,me}from"./chunk-yn6a84c7.js";import{V,re}from"./chunk-e00dz09f.js";import{De,pe}from"./chunk-j1frpcqd.js";import{cn as F}from"cn";import{BoxIcon as S,ChevronRightIcon as U,PlusIcon as E,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as M}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as z,DropdownMenuContent as L,DropdownMenuGroup as N,DropdownMenuItem as y,DropdownMenuRadioGroup as j,DropdownMenuRadioItem as _,DropdownMenuSeparator as K,DropdownMenuTrigger as q}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as J}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function pi({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:k=n?"none":void 0,allowRemove:O=!0,submenu:g=!1,className:R,onOpenChange:x}){let{t}=A(),c=pe(),B=me(),T=Ee(),{collections:s,order:C}=De(),i=C.find((o)=>s[o].sessionIds.includes(l)),[H,P]=d(!1),[w,D]=d(!1),[m,b]=d(""),[r,h]=d(!1),v=(o)=>{if(P(o),T(o),x?.(o),!o)D(!1),b("")},p=(o)=>{h(!0),B(o.then(()=>{v(!1)}).finally(()=>h(!1)))};return a(z,{modal:!1,open:H,onOpenChange:(o,I)=>{if(!o&&w&&I.reason==="trigger-hover"){I.cancel();return}v(o)},children:[e(q,{disabled:r,"data-hover-background":k,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(M,{variant:"ghost",size:"icon-sm",className:R,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:F(i!==void 0&&"fill-current")})})}),a(L,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(N,{children:e(j,{value:i??null,children:C.map((o)=>a(_,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===V?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(S,{}),e("span",{className:"min-w-0 flex-1 truncate",children:re(s[o],t)})]},o))})}),e(K,{}),a(N,{children:[a(y,{disabled:r,closeOnClick:!1,onClick:()=>D(!0),children:[e(E,{}),t("collection.newCollection")]}),O&&i!==void 0&&a(y,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(J,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>b(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(M,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function Qs({sessionId:l,allowRemove:f=!0}){let{t:n}=A();return e(pi,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(G,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(U,{className:"rtl:rotate-180"})})})}
2
- export{pi,Qs};
1
+ import{G}from"./chunk-jp4xjks0.js";import{Ee}from"./chunk-chn1mkv0.js";import{A,me}from"./chunk-aht6f6tf.js";import{V,re}from"./chunk-e00dz09f.js";import{De,pe}from"./chunk-fwb6tf7m.js";import{cn as F}from"cn";import{BoxIcon as S,ChevronRightIcon as U,PlusIcon as E,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as M}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as z,DropdownMenuContent as L,DropdownMenuGroup as N,DropdownMenuItem as y,DropdownMenuRadioGroup as j,DropdownMenuRadioItem as _,DropdownMenuSeparator as K,DropdownMenuTrigger as q}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as J}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function ui({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:k=n?"none":void 0,allowRemove:O=!0,submenu:g=!1,className:R,onOpenChange:x}){let{t}=A(),c=pe(),B=me(),T=Ee(),{collections:s,order:C}=De(),i=C.find((o)=>s[o].sessionIds.includes(l)),[H,P]=d(!1),[w,D]=d(!1),[m,b]=d(""),[r,h]=d(!1),v=(o)=>{if(P(o),T(o),x?.(o),!o)D(!1),b("")},p=(o)=>{h(!0),B(o.then(()=>{v(!1)}).finally(()=>h(!1)))};return a(z,{modal:!1,open:H,onOpenChange:(o,I)=>{if(!o&&w&&I.reason==="trigger-hover"){I.cancel();return}v(o)},children:[e(q,{disabled:r,"data-hover-background":k,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(M,{variant:"ghost",size:"icon-sm",className:R,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:F(i!==void 0&&"fill-current")})})}),a(L,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(N,{children:e(j,{value:i??null,children:C.map((o)=>a(_,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===V?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(S,{}),e("span",{className:"min-w-0 flex-1 truncate",children:re(s[o],t)})]},o))})}),e(K,{}),a(N,{children:[a(y,{disabled:r,closeOnClick:!1,onClick:()=>D(!0),children:[e(E,{}),t("collection.newCollection")]}),O&&i!==void 0&&a(y,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(J,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>b(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(M,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function Qs({sessionId:l,allowRemove:f=!0}){let{t:n}=A();return e(ui,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(G,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(U,{className:"rtl:rotate-180"})})})}
2
+ export{ui,Qs};
@@ -1,2 +1,2 @@
1
- import{ss}from"./chunk-dxwbgg69.js";import{CheckIcon as M,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function N({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[u,m]=f(!1),[l,b]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=()=>{if(r.scrollHeight===0){m(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");m(r.scrollHeight>A*x+1)};d();let t=new ResizeObserver(d);return t.observe(r),()=>t.disconnect()},[]),k(()=>{if(!u||l)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=new Map,t=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let y=g.target;if(!d.has(y))continue;v(y,g.isIntersecting&&g.intersectionRatio>=1,d.get(y))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let i of d.keys()){if(r.contains(i))continue;t?.unobserve(i),d.delete(i)}for(let i of r.querySelectorAll(L)){if(d.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");d.set(i,g),v(i,t===null&&R(i,r),g),t?.observe(i)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{t?.disconnect(),C.disconnect();for(let[i,g]of d)v(i,!0,g)}},[u,l]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:u&&!l?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),u&&!l&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),u&&p("button",{type:"button","aria-expanded":l,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:l?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:l?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Go({text:n,label:o,host:s}){let[a,c]=f(!1),[u,m]=f(null),l=async()=>{c(!1),m(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(b){m(String(b)),s?.onCopyError?.(b)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:u??o,onClick:()=>void l(),children:a?e(M,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(ss,{src:c,alt:"",onClose:()=>a(!1)})]})}function rs({message:n,text:o,textParts:s,applicationReferences:a,mentions:c,images:u,messageTime:m,host:l,bubbleStyle:b}){let{t:r,openImage:d}=l;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[c.length>0&&e("div",{className:"codex-user-mentions",children:c.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),u.length>0&&e("div",{className:"codex-user-images",children:u.map((t)=>e(S,{image:t,openImage:d},`${t.mimeType}:${t.data}`))}),(o.length>0||a)&&e(h,{children:p("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:b,children:[a,s?s.map((t,x)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(N,{text:t.text,host:l}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},x)):e(N,{text:o,host:l})]})}),p("div",{className:"codex-user-actions",children:[e(Go,{text:o,label:r("actions.copy"),host:l}),m&&e("span",{className:"codex-user-time",title:m.full,children:m.short})]})]})})}
2
- export{Go,rs};
1
+ import{ss}from"./chunk-dxwbgg69.js";import{CheckIcon as M,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function N({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[u,m]=f(!1),[l,b]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=()=>{if(r.scrollHeight===0){m(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");m(r.scrollHeight>A*x+1)};d();let t=new ResizeObserver(d);return t.observe(r),()=>t.disconnect()},[]),k(()=>{if(!u||l)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=new Map,t=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let y=g.target;if(!d.has(y))continue;v(y,g.isIntersecting&&g.intersectionRatio>=1,d.get(y))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let i of d.keys()){if(r.contains(i))continue;t?.unobserve(i),d.delete(i)}for(let i of r.querySelectorAll(L)){if(d.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");d.set(i,g),v(i,t===null&&R(i,r),g),t?.observe(i)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{t?.disconnect(),C.disconnect();for(let[i,g]of d)v(i,!0,g)}},[u,l]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:u&&!l?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),u&&!l&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),u&&p("button",{type:"button","aria-expanded":l,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:l?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:l?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function Bo({text:n,label:o,host:s}){let[a,c]=f(!1),[u,m]=f(null),l=async()=>{c(!1),m(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(b){m(String(b)),s?.onCopyError?.(b)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:u??o,onClick:()=>void l(),children:a?e(M,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(ss,{src:c,alt:"",onClose:()=>a(!1)})]})}function rs({message:n,text:o,textParts:s,applicationReferences:a,mentions:c,images:u,messageTime:m,host:l,bubbleStyle:b}){let{t:r,openImage:d}=l;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[c.length>0&&e("div",{className:"codex-user-mentions",children:c.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),u.length>0&&e("div",{className:"codex-user-images",children:u.map((t)=>e(S,{image:t,openImage:d},`${t.mimeType}:${t.data}`))}),(o.length>0||a)&&e(h,{children:p("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:b,children:[a,s?s.map((t,x)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(N,{text:t.text,host:l}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},x)):e(N,{text:o,host:l})]})}),p("div",{className:"codex-user-actions",children:[e(Bo,{text:o,label:r("actions.copy"),host:l}),m&&e("span",{className:"codex-user-time",title:m.full,children:m.short})]})]})})}
2
+ export{Bo,rs};
@@ -1,2 +1,2 @@
1
- import{A}from"./chunk-yn6a84c7.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function mt({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=A();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
1
+ import{A}from"./chunk-aht6f6tf.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function mt({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=A();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
2
  export{mt};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Ce(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ko(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{Ce,Ko};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Ce(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function qo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{Ce,qo};
@@ -1,2 +1,2 @@
1
- import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function Si({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(c,{size:"sm",children:[e(m,{children:[a(p,{children:i("approval.needed")}),a(v,{children:r})]}),a(s,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(C,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
- export{Si};
1
+ import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function ki({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(c,{size:"sm",children:[e(m,{children:[a(p,{children:i("approval.needed")}),a(v,{children:r})]}),a(s,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(C,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
+ export{ki};
@@ -1,2 +1,2 @@
1
- import{Ne}from"./chunk-zxfx7psd.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function oi({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:Ne(t)}):null}function ii({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(oi,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Kt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(ii,{label:t,shortcut:o}):t})]})}
2
- export{oi,ii,Kt};
1
+ import{Ne}from"./chunk-ermc9p1p.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function ni({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:Ne(t)}):null}function oi({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(ni,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Kt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(oi,{label:t,shortcut:o}):t})]})}
2
+ export{ni,oi,Kt};
@@ -1,2 +1,2 @@
1
- var aa={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function _i(e){return[...e].toSorted((o,n)=>(aa[o.kind]??99)-(aa[n.kind]??99))}function ja(e){return e==="allow_once"||e==="allow_always"}function $a(e){return e==="allow_always"||e==="reject_always"}
2
- export{aa,_i,ja,$a};
1
+ var aa={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Si(e){return[...e].toSorted((o,n)=>(aa[o.kind]??99)-(aa[n.kind]??99))}function ja(e){return e==="allow_once"||e==="allow_always"}function $a(e){return e==="allow_always"||e==="reject_always"}
2
+ export{aa,Si,ja,$a};
@@ -0,0 +1,2 @@
1
+ import{fromMcpServer as I}from"@agentclientprotocol/sdk/experimental/mcp-server";import{MCP_META_CLIENT_CAPABILITIES as h,MCP_META_CLIENT_INFO as T,MCP_META_PROTOCOL_VERSION as v,MCP_PROTOCOL_VERSION as w,McpBindingErrorCode as A}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{Server as C}from"@modelcontextprotocol/server";function Rn(n){let{parse:t,execute:e,...s}=n;return{...s,execute:(o,i)=>e(t(o),i)}}var co="alwith";function S(n){if(n.length>128)throw Error("Too many application tools");let t=new Map;for(let e of n){if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(e.name)||t.has(e.name))throw Error(`Invalid or duplicate application tool: ${e.name}`);if(!e.description.trim()||e.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${e.name}`);t.set(e.name,{...e,inputSchema:structuredClone(e.inputSchema)})}return t}class p extends Error{code;data;constructor(n,t,e){super(t);this.code=n,this.data=e}}var m=(n)=>({content:[{type:"text",text:n instanceof Error?n.message:String(n)}],isError:!0});class uo{servers=new Map;requests=new Map;session;identity;constructor(n,t){this.session=n,this.identity=t}declare(n){let t=crypto.randomUUID(),e={tools:S(n),sessionId:null,active:new Map,calls:new Map,mcp:I(()=>this.server(e))};return this.servers.set(t,e),{type:"acp",name:co,serverId:t}}bind(n,t){let e=this.servers.get(n);if(!e)throw Error(`Application tool server is not registered: ${n}`);for(let[s,o]of this.servers)if(o.sessionId===t)this.dispose(s);e.sessionId=t}cancel(n){for(let t of this.servers.values())if(t.sessionId===n)for(let e of t.active.values())e.abort()}drop(n){for(let[t,e]of this.servers)if(e.sessionId===n)this.dispose(t)}clear(){for(let n of this.servers.keys())this.dispose(n)}dispose(n){let t=this.servers.get(n);if(!t)return;this.servers.delete(n);for(let e of t.active.values())e.abort();t.mcp.close()}withdraw(n){let t=this.requests.get(JSON.stringify(n));if(!t)return!1;return t.abort(),!0}handle(n,t){if(t.method!=="mcp/message")return!1;let e=JSON.stringify(t.id),s=new AbortController;return this.requests.set(e,s),this.message(n,t.params,s.signal).then((o)=>n.respond(t.id,o),(o)=>n.respond(t.id,void 0,o instanceof p?{code:o.code,message:o.message,...o.data===void 0?{}:{data:o.data}}:{code:A.backendFailed,message:"MCP server handler failed",data:{details:o instanceof Error?o.message:String(o)}})).finally(()=>{if(this.requests.get(e)===s)this.requests.delete(e)}).catch(()=>{return}),!0}async message(n,t,e){let s=t;if(!s||typeof s!=="object"||typeof s.serverId!=="string"||typeof s.requestId!=="string"||typeof s.method!=="string"||s.params!=null&&(typeof s.params!=="object"||Array.isArray(s.params)))throw new p(-32602,"Invalid mcp/message params");let{serverId:o,requestId:i,method:c}=s,d=s.params??void 0,r=this.servers.get(o);if(!r)throw new p(A.serverUnavailable,"MCP server registration unavailable",{serverId:o});if(r.active.has(i))throw new p(-32602,"duplicate active MCP request ID",{serverId:o,requestId:i});let a=d?._meta,u=a?.[v],g=a?.[h];if(typeof u!=="string")return{error:{code:-32602,message:`missing ${v} in params._meta`}};if(u!==w)return{error:{code:-32022,message:"Unsupported protocol version",data:{supported:[w],requested:u}}};if(!g||typeof g!=="object"||Array.isArray(g))return{error:{code:-32602,message:`missing ${h} in params._meta`}};let l=new AbortController,y=()=>l.abort();if(e.addEventListener("abort",y,{once:!0}),r.active.set(i,l),r.sessionId!==null)r.calls.set(i,{agent:n,sessionId:r.sessionId,signal:l.signal});try{let f=await r.mcp.handler({serverId:o,requestId:i,method:c,params:d,protocolVersion:u,clientCapabilities:g,clientInfo:a?.[T],envelopeMeta:s._meta,signal:l.signal,notify:async()=>{return}});return l.signal.throwIfAborted(),f}catch(f){if(l.signal.aborted)throw new p(A.requestCancelled,"MCP request was cancelled");throw f}finally{e.removeEventListener("abort",y),r.active.delete(i),r.calls.delete(i)}}server(n){let t=new C({name:co,version:"1.0.0"},{capabilities:{tools:{}}});return t.setRequestHandler("tools/list",()=>({tools:[...n.tools.values()].map((e)=>({name:e.name,...e.title===void 0?{}:{title:e.title},description:e.description,inputSchema:structuredClone(e.inputSchema),...e.annotations===void 0?{}:{annotations:e.annotations}}))})),t.setRequestHandler("tools/call",async(e,s)=>{let o=n.calls.get(String(s.mcpReq.id)),i=n.tools.get(e.params.name);if(!i)return m(Error(`Application tool is not registered: ${e.params.name}`));if(!o)return m(Error("Application tool session is not attached"));let c=this.session(o.sessionId);if(!c?.attached||c.readOnly)return m(Error("Application tool session is not attached"));let{toolCallId:d,turnId:r}=this.identity(e.params._meta??{});try{o.signal.throwIfAborted();let a=await i.execute(e.params.arguments??{},{sessionId:o.sessionId,toolCallId:d,turnId:r,signal:o.signal,agent:o.agent});return o.signal.throwIfAborted(),a}catch(a){if(o.signal.aborted)throw a;return m(a)}}),t}}
2
+ export{Rn,co,uo};
@@ -1,2 +1,2 @@
1
- import{d,i}from"./chunk-j5dqww4h.js";import{k}from"./chunk-qk1yqepm.js";import{B}from"./chunk-2kbp0pbe.js";import{Se}from"./chunk-d06382wz.js";import{Q,_e,Pe}from"./chunk-pqz2471h.js";import{ExternalLinkIcon as M,PlusIcon as W}from"lucide-react";import{useEffect as _,useState as y}from"react";import{Badge as L}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as q,DialogContent as F,DialogDescription as G,DialogHeader as J,DialogTitle as K}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as s,Fragment as O}from"react/jsx-runtime";function jt({entry:o,onBack:p}){let u=d(),{t:l}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===o.plugin.id)),v=i((a)=>a.busyIds[o.plugin.id]),T=i((a)=>a.install),H=i((a)=>a.uninstall),V=i((a)=>a.setPluginEnabled),[n,U]=y(null),[D,I]=y(null),[j,R]=y(0),[c,z]=y(null);_(()=>{let a=!0;return I(null),U(null),P(o).then((g)=>{if(a)U(g)},(g)=>{if(a)I(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[o,P,j]);let m=n?.summary??o.plugin,r=C?.plugin??m,t=m.interface,h=t?.displayName??m.name,b=r.availability!=="AVAILABLE"||r.installPolicy==="NOT_AVAILABLE",E=t?.longDescription??n?.description??t?.shortDescription,A=[...u.assetUrl?t?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...t?.screenshotUrls??[]];return s("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(Pe,{children:s("header",{className:"flex min-w-0 flex-col gap-4",children:[s("nav",{"aria-label":l("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(f,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:l("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:h})]}),s("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[s("div",{className:"flex min-w-0 items-center gap-3",children:[e(B,{name:m.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:h})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?s(O,{children:[r.source.type==="remote"?null:e(X,{checked:r.enabled,disabled:!!v||b,"aria-label":l(r.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:h}),onCheckedChange:(a)=>void V(r,a)}),e(f,{variant:"outline",size:"sm",disabled:!!v,onClick:()=>void H(r),children:v?e(S,{}):l("plugins.detail.uninstall")})]}):e(f,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":l(b?"plugins.detail.unavailable":"plugins.detail.install"),title:l(b?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!v||b,onClick:()=>void T({...o,plugin:m}).catch(()=>{}),children:v?e(S,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} pt-2`,children:[t?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:t.shortDescription}),m.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(m.keywords)].map((a)=>e(L,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),s("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[t?.developerName&&e(x,{label:l("plugins.detail.developer"),children:t.developerName}),t?.category&&e(x,{label:l("plugins.detail.category"),children:t.category}),(r.localVersion??r.version)&&e(x,{label:l("plugins.detail.version"),children:r.localVersion??r.version}),e(x,{label:l("plugins.headings.marketplace"),children:o.marketplace.interface?.displayName??o.marketplace.name}),t?.websiteUrl&&e(x,{label:l("plugins.detail.website"),children:e(w,{url:t.websiteUrl,label:l("plugins.detail.website")})})]}),!n&&!D&&s("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),l("plugins.detail.loading")]}),D&&s("div",{role:"alert",className:"mt-8 space-y-2",children:[s("p",{className:"text-destructive text-sm",children:[l("plugins.detail.errorTitle"),": ",D]}),e(f,{variant:"outline",size:"sm",className:"h-9",onClick:()=>R((a)=>a+1),children:l("plugins.loadError.retry")})]}),E&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:E}),A.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(A)].map((a)=>e("img",{src:a,alt:h,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),t&&t.capabilities.length>0&&e(N,{label:l("plugins.detail.capabilities"),count:t.capabilities.length,children:t.capabilities.map((a)=>e(L,{variant:"secondary",className:"me-2",children:a},a))}),n&&n.mcpServers.length>0&&e(N,{label:l("plugins.detail.mcpServers"),count:n.mcpServers.length,children:n.mcpServers.map((a)=>s("div",{className:"flex items-center gap-3 py-1",children:[e(B,{name:m.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),n&&n.skills.length>0&&e(N,{label:l("plugins.detail.skills"),count:n.skills.length,children:n.skills.map((a)=>s(f,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(B,{name:a.name,className:"size-8"}),s("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),n&&n.apps.length>0&&e(N,{label:l("plugins.detail.apps"),count:n.apps.length,children:n.apps.map((a)=>s("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:l("plugins.installModal.connect")})]},a.id))}),n&&n.hooks.length>0&&e(N,{label:l("plugins.detail.hooks"),count:n.hooks.length,children:n.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(t?.privacyPolicyUrl||t?.termsOfServiceUrl)&&s("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[t.privacyPolicyUrl&&e(w,{url:t.privacyPolicyUrl,label:l("plugins.detail.privacyPolicy")}),t.termsOfServiceUrl&&e(w,{url:t.termsOfServiceUrl,label:l("plugins.detail.termsOfService")})]})]})}),e(q,{open:c!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(F,{className:_e,children:c&&s(O,{children:[e("div",{className:"shrink-0 pr-8",children:e(B,{name:c.name,className:"size-10"})}),s("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[s(J,{className:"gap-3",children:[e(K,{className:"text-2xl leading-8 font-semibold break-words",children:c.interface?.displayName??c.name}),e(G,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:c.description})]}),e(Se,{path:c.path,description:c.description},c.path??c.name)]})]})})})]})}function x({label:o,children:p}){return s("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:o}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function N({label:o,count:p,children:u}){return s("section",{className:"mt-8",children:[s("h2",{className:"text-base font-medium",children:[o," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:o,label:p}){let{openLink:u}=d();if(!/^https?:\/\//i.test(o))return null;return s(f,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:o,onClick:()=>u(o),children:[p,e(M,{className:"size-3.5"})]})}
1
+ import{d,i}from"./chunk-njqan8zg.js";import{k}from"./chunk-qk1yqepm.js";import{B}from"./chunk-m68t534g.js";import{Se}from"./chunk-3qedn07q.js";import{Q,_e,Pe}from"./chunk-pqz2471h.js";import{ExternalLinkIcon as M,PlusIcon as W}from"lucide-react";import{useEffect as _,useState as y}from"react";import{Badge as L}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as q,DialogContent as F,DialogDescription as G,DialogHeader as J,DialogTitle as K}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as s,Fragment as O}from"react/jsx-runtime";function jt({entry:o,onBack:p}){let u=d(),{t:l}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===o.plugin.id)),v=i((a)=>a.busyIds[o.plugin.id]),T=i((a)=>a.install),H=i((a)=>a.uninstall),V=i((a)=>a.setPluginEnabled),[n,U]=y(null),[D,I]=y(null),[j,R]=y(0),[c,z]=y(null);_(()=>{let a=!0;return I(null),U(null),P(o).then((g)=>{if(a)U(g)},(g)=>{if(a)I(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[o,P,j]);let m=n?.summary??o.plugin,r=C?.plugin??m,t=m.interface,h=t?.displayName??m.name,b=r.availability!=="AVAILABLE"||r.installPolicy==="NOT_AVAILABLE",E=t?.longDescription??n?.description??t?.shortDescription,A=[...u.assetUrl?t?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...t?.screenshotUrls??[]];return s("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(Pe,{children:s("header",{className:"flex min-w-0 flex-col gap-4",children:[s("nav",{"aria-label":l("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(f,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:l("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:h})]}),s("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[s("div",{className:"flex min-w-0 items-center gap-3",children:[e(B,{name:m.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:h})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?s(O,{children:[r.source.type==="remote"?null:e(X,{checked:r.enabled,disabled:!!v||b,"aria-label":l(r.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:h}),onCheckedChange:(a)=>void V(r,a)}),e(f,{variant:"outline",size:"sm",disabled:!!v,onClick:()=>void H(r),children:v?e(S,{}):l("plugins.detail.uninstall")})]}):e(f,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":l(b?"plugins.detail.unavailable":"plugins.detail.install"),title:l(b?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!v||b,onClick:()=>void T({...o,plugin:m}).catch(()=>{}),children:v?e(S,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} pt-2`,children:[t?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:t.shortDescription}),m.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(m.keywords)].map((a)=>e(L,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),s("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[t?.developerName&&e(x,{label:l("plugins.detail.developer"),children:t.developerName}),t?.category&&e(x,{label:l("plugins.detail.category"),children:t.category}),(r.localVersion??r.version)&&e(x,{label:l("plugins.detail.version"),children:r.localVersion??r.version}),e(x,{label:l("plugins.headings.marketplace"),children:o.marketplace.interface?.displayName??o.marketplace.name}),t?.websiteUrl&&e(x,{label:l("plugins.detail.website"),children:e(w,{url:t.websiteUrl,label:l("plugins.detail.website")})})]}),!n&&!D&&s("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),l("plugins.detail.loading")]}),D&&s("div",{role:"alert",className:"mt-8 space-y-2",children:[s("p",{className:"text-destructive text-sm",children:[l("plugins.detail.errorTitle"),": ",D]}),e(f,{variant:"outline",size:"sm",className:"h-9",onClick:()=>R((a)=>a+1),children:l("plugins.loadError.retry")})]}),E&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:E}),A.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(A)].map((a)=>e("img",{src:a,alt:h,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),t&&t.capabilities.length>0&&e(N,{label:l("plugins.detail.capabilities"),count:t.capabilities.length,children:t.capabilities.map((a)=>e(L,{variant:"secondary",className:"me-2",children:a},a))}),n&&n.mcpServers.length>0&&e(N,{label:l("plugins.detail.mcpServers"),count:n.mcpServers.length,children:n.mcpServers.map((a)=>s("div",{className:"flex items-center gap-3 py-1",children:[e(B,{name:m.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),n&&n.skills.length>0&&e(N,{label:l("plugins.detail.skills"),count:n.skills.length,children:n.skills.map((a)=>s(f,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(B,{name:a.name,className:"size-8"}),s("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),n&&n.apps.length>0&&e(N,{label:l("plugins.detail.apps"),count:n.apps.length,children:n.apps.map((a)=>s("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:l("plugins.installModal.connect")})]},a.id))}),n&&n.hooks.length>0&&e(N,{label:l("plugins.detail.hooks"),count:n.hooks.length,children:n.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(t?.privacyPolicyUrl||t?.termsOfServiceUrl)&&s("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[t.privacyPolicyUrl&&e(w,{url:t.privacyPolicyUrl,label:l("plugins.detail.privacyPolicy")}),t.termsOfServiceUrl&&e(w,{url:t.termsOfServiceUrl,label:l("plugins.detail.termsOfService")})]})]})}),e(q,{open:c!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(F,{className:_e,children:c&&s(O,{children:[e("div",{className:"shrink-0 pr-8",children:e(B,{name:c.name,className:"size-10"})}),s("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[s(J,{className:"gap-3",children:[e(K,{className:"text-2xl leading-8 font-semibold break-words",children:c.interface?.displayName??c.name}),e(G,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:c.description})]}),e(Se,{path:c.path,description:c.description},c.path??c.name)]})]})})})]})}function x({label:o,children:p}){return s("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:o}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function N({label:o,count:p,children:u}){return s("section",{className:"mt-8",children:[s("h2",{className:"text-base font-medium",children:[o," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:o,label:p}){let{openLink:u}=d();if(!/^https?:\/\//i.test(o))return null;return s(f,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:o,onClick:()=>u(o),children:[p,e(M,{className:"size-3.5"})]})}
2
2
  export{jt};
@@ -1,2 +1,2 @@
1
- import{E}from"./chunk-44r55va6.js";import{s}from"./chunk-ytdhstqx.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function js({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return E(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
1
+ import{E}from"./chunk-r5f77gtx.js";import{s}from"./chunk-5mjs63fv.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function js({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return E(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
2
  export{js};
@@ -1,2 +1,2 @@
1
- function*_o(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function xr(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of _o(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
- export{_o,xr};
1
+ function*So(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function xr(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of So(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
+ export{So,xr};
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-j5dqww4h.js";import{q,K,W,Z}from"./chunk-gdtpwbqn.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function we({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(K,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(q,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
1
+ import{d}from"./chunk-njqan8zg.js";import{q,K,W,Z}from"./chunk-gdtpwbqn.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function we({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(K,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(q,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
2
  export{we};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-ytdhstqx.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Me(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>Me(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!Me(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Jn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Bs(t){u.get(t)?.set(v(t))}function J(t){let n=Jn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function de(){return Jn(a()).set}function Gs(){let t=J((e)=>e.view),n=de();return[t,(e)=>n({view:e})]}
2
- export{Me,Jn,Bs,J,de,Gs};
1
+ import{a}from"./chunk-5mjs63fv.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Me(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>Me(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!Me(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Qn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Bs(t){u.get(t)?.set(v(t))}function J(t){let n=Qn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function de(){return Qn(a()).set}function Gs(){let t=J((e)=>e.view),n=de();return[t,(e)=>n({view:e})]}
2
+ export{Me,Qn,Bs,J,de,Gs};
@@ -1,2 +1,2 @@
1
- import{Dt}from"./chunk-gxb9n7g7.js";import{d,Ze}from"./chunk-j5dqww4h.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function Yo(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Se({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ze(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ze(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Ze(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:Yo(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
- export{Yo,Se};
1
+ import{Dt}from"./chunk-gbsn1qep.js";import{d,Ze}from"./chunk-njqan8zg.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function Xo(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Se({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ze(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ze(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Ze(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:Xo(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
+ export{Xo,Se};
@@ -1,2 +1,2 @@
1
- import{Ki,Un,Bn,Gn,zn}from"./chunk-jzbg0cx9.js";import{Hn}from"./chunk-7jk8s061.js";var Dn=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",webSearch:"deepseek",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var a=Dn,p={anthropic:Ki,deepseek:Un,openrouter:Gn,qwen:zn,xai:Bn};function c(e){let n=p[e];if(!n)throw Error(`Provider ${e} has no logo`);return n}var R=a.filter((e)=>e.source!=="account").map(({source:e,...n})=>({...n,logo:c(n.id)}));function bt(e){return e!=null&&a.some((n)=>n.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(n.id)}:`))}function Ct(e){let n=JSON.parse(e);if(!Array.isArray(n)||n.length===0)throw Error("Add at least one model");let t=new Set;return n.map((i)=>{if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("Each model must be an object");let o=i,s=typeof o.label==="string"?o.label.trim():"",r=typeof o.api_id==="string"?o.api_id.trim():"";if(s===""||r==="")throw Error("Model label and API ID cannot be empty");if(t.has(r))throw Error("Model IDs must be unique");if(t.add(r),o.contextWindow!==void 0&&o.contextWindow!==null&&(!Number.isSafeInteger(o.contextWindow)||o.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(o.description!==void 0&&typeof o.description!=="string")throw Error("Model description must be a string");return{label:s,api_id:r,...o.contextWindow===void 0?{}:{contextWindow:o.contextWindow},...o.description===void 0?{}:{description:o.description}}})}function he(e){return[...R.filter((n)=>e.providers[n.id]!==void 0).map((n)=>({id:n.id,name:n.name,models:n.models})),...[...e.customProviders,...e.managedProviders??[]].map((n)=>({id:n.id,name:n.name,models:n.models.map((t)=>({id:t.api_id,label:t.label,...t.description==null?{}:{description:t.description}}))}))]}function S(e,n){let t=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(i)=>i.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(t)}:${encodeURIComponent(n)}`}function ya(e,n,t="session",i=bt){let o=he(n).flatMap((s)=>s.models.map((r)=>S(s.id,r.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(e!==null&&t==="session")throw Error(i(e)?"The selected ALwith account model is unavailable. Select another model before sending.":"The selected model connection is unavailable. Select another model before sending.");return o[0]??null}function se(e,n){if(!e.regions)return null;let t=e.regions.find((i)=>i.id===n)??e.regions[0];if(!t)throw Error(`Provider ${e.id} declares no regions`);return t}function Fn(e,n){return se(e,n)?.keyUrl??e.keyUrl??null}function On(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function xa(e){let n=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let t=decodeURIComponent(n[1]),i=Hn.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var wt=l;function ba(e){return wt[e]??{}}
2
- export{Dn,R,bt,Ct,he,S,ya,se,Fn,On,xa,wt,ba};
1
+ import{Ki,Hn,Un,Bn,Gn}from"./chunk-dd9k5bbt.js";import{On}from"./chunk-xwwjj45a.js";var Ln=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",webSearch:"deepseek",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var a=Ln,p={anthropic:Ki,deepseek:Hn,openrouter:Bn,qwen:Gn,xai:Un};function c(e){let n=p[e];if(!n)throw Error(`Provider ${e} has no logo`);return n}var R=a.filter((e)=>e.source!=="account").map(({source:e,...n})=>({...n,logo:c(n.id)}));function bt(e){return e!=null&&a.some((n)=>n.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(n.id)}:`))}function Ct(e){let n=JSON.parse(e);if(!Array.isArray(n)||n.length===0)throw Error("Add at least one model");let t=new Set;return n.map((i)=>{if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("Each model must be an object");let o=i,s=typeof o.label==="string"?o.label.trim():"",r=typeof o.api_id==="string"?o.api_id.trim():"";if(s===""||r==="")throw Error("Model label and API ID cannot be empty");if(t.has(r))throw Error("Model IDs must be unique");if(t.add(r),o.contextWindow!==void 0&&o.contextWindow!==null&&(!Number.isSafeInteger(o.contextWindow)||o.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(o.description!==void 0&&typeof o.description!=="string")throw Error("Model description must be a string");return{label:s,api_id:r,...o.contextWindow===void 0?{}:{contextWindow:o.contextWindow},...o.description===void 0?{}:{description:o.description}}})}function he(e){return[...R.filter((n)=>e.providers[n.id]!==void 0).map((n)=>({id:n.id,name:n.name,models:n.models})),...[...e.customProviders,...e.managedProviders??[]].map((n)=>({id:n.id,name:n.name,models:n.models.map((t)=>({id:t.api_id,label:t.label,...t.description==null?{}:{description:t.description}}))}))]}function S(e,n){let t=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(i)=>i.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(t)}:${encodeURIComponent(n)}`}function ya(e,n,t="session",i=bt){let o=he(n).flatMap((s)=>s.models.map((r)=>S(s.id,r.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(e!==null&&t==="session")throw Error(i(e)?"The selected ALwith account model is unavailable. Select another model before sending.":"The selected model connection is unavailable. Select another model before sending.");return o[0]??null}function se(e,n){if(!e.regions)return null;let t=e.regions.find((i)=>i.id===n)??e.regions[0];if(!t)throw Error(`Provider ${e.id} declares no regions`);return t}function Dn(e,n){return se(e,n)?.keyUrl??e.keyUrl??null}function Fn(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function xa(e){let n=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let t=decodeURIComponent(n[1]),i=On.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var wt=l;function ba(e){return wt[e]??{}}
2
+ export{Ln,R,bt,Ct,he,S,ya,se,Dn,Fn,xa,wt,ba};